/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/exitexamine_main.tpl");
    require("./assets/css/exitexamine_main.css");

    //business

    //component
    var ExitExamineSubnav = require("./component/ExitExamineSubnav");
    var ExitExamineForm = require("./component/ExitExamineForm");
    var ExitExamineGrid = require("./component/ExitExamineGrid");
    var couponGridComp = require("./component/couponGridComp");
    var examineGridComp = require("./component/examineGridComp");
    var ApprovalUI = require("approvalUI");
    //constant

    //handler
    var handler = require("./handler/exitexmine_Events");
    var service = require("./service/exitexmineSvc");
    //store

    var App = ELView.extend({
        attrs: {
            template: template
        },
        handler: handler,
        service: service,
//        constant:constant,
        initComponent: function (params, widget) {
        	ExitExamineSubnav.initComponent(params, widget);
        	ExitExamineGrid.initComponent(params, widget);
        	ExitExamineForm.initComponent(params, widget);
        	couponGridComp.initComponent(params, widget);
        	examineGridComp.initComponent(params, widget);
        	
        	var  approvalUI = new ApprovalUI({
				parentNode : ".J-approvalUI",
			});
			approvalUI.render();
			this.set("approvalUI",approvalUI);
        	
        },
        afterInitComponent: function (params, widget) {
            
        },
        toGrid: function(){
        	this.show([".J-grid"]).hide([".J-form",".J-couponGrid",".J-approvalUI",".J-approvalUI"]);
			this.get("subnav").hide(["back"]).show(["search","status"]);
        },
        toForm: function(){
        	this.get("form").reset();
        	this.show([".J-form",".J-couponGrid",".J-approvalUI"]).hide([".J-grid"]);
			this.get("subnav").hide(["search","status"]).show(["back"]);			
			
        }
    });

    module.exports = App;
});
